package com.boot.project.admin.shiro.util;

import com.boot.project.core.constant.SystemConstant;
import org.apache.shiro.crypto.hash.SimpleHash;

/**
 * @description:
 * @author: tsing
 * @create: 2021-03-08 19:47
 */
public class EncryptUtils {

    /**
     * shiro中使用的MD5加密
     * @param rawPassword 待加密的密码
     * @param salt 加密盐
     * @return
     */
    public static String encrypt(String rawPassword, String salt) {
        return new SimpleHash(SystemConstant.ENCRYPT_ARITHMETIC, rawPassword,
                salt, SystemConstant.ENCRYPT_TIMES).toString();
    }
}
